package org.smart4j.framework.demo.aspect;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smart4j.framework.annotation.Aspect;
import org.smart4j.framework.annotation.Controller;
import org.smart4j.framework.proxy.AspectProxy;

import java.lang.reflect.Method;


/**
 * Created by liangyue on 2018/1/11.
 */


@Aspect(Controller.class)
public class PrintAspect extends AspectProxy {
	private static final Logger LOGGER =
			LoggerFactory.getLogger(PrintAspect.class);

	@Override
	public void before(Class<?> cls, Method method, Object[] params)
			throws Throwable{
		System.out.println("come in "+ method.getName().toString());
	}

	@Override
	public void after(Class<?> cls, Method method, Object[] params,
					  Object result) throws Throwable{
		System.out.println("leave "+ method.getName().toString());
	}
}
